Example Presentation

How to use quartoMorphSvg

Installing package:

if(!"quartoMorphSvg" %in% rownames(installed.packages())){
  devtools::install_github("klingelhoefer/quartoMorphSvg")
}
library(quartoMorphSvg)

To display an animated image, you can simply write inline (replace with your path(s):

`r morph_svg("path/to/img_1.svg", "path/to/img_1.svg")` 

Or use {r} codechunks:

morph_svg("path/to/img_1.svg", "path/to/img_1.svg")

Moderation Example

X Y Z

To generate the image above:

`r morph_svg(folder = "images/moderation")`

Mediation Example

morph_svg(folder = "images/mediation", animation_duration  = 1)
M X Y

Tidyverse Logo Example

Any order can be specified/repeated an arbitrary amount of times, e.g.,

`r morph_svg("images/tidyverse/1.svg", "images/tidyverse/2.svg", "images/tidyverse/3.svg", "images/tidyverse/2.svg", "images/tidyverse/1.svg", height = "500px")`

Note that complex images may take a while to render

Monstera Example

The generated output can be used in any other HTML document, and even standalone. In non-quarto documents it will only react to clicking, thus, click should be TRUE (the default).

`r morph_svg(folder = "images/monstera/", animation_duration = 1.25, click = F, height = "14em")`